home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 6_5.lha / 6_5 / tst1.c < prev    next >
Text File  |  1993-08-08  |  488b  |  24 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. include <6_5.h>
  6. include <error.h>
  7.  
  8. ain()
  9.  
  10.    string x[100];
  11.    cout << "here we go\n";
  12.    for (int n = 0; cin>>x[n]; n++) 
  13. {
  14. string y;
  15. if (n == 100) error("too many strings");
  16. cout << (y = x[n]) << "\n";
  17. if (y == "done") break;
  18. }
  19.    cout << "here we go back again\n";
  20.    for (int i = n-1; 0 <= i; i--)
  21.        cout << x[i] << "\n";
  22.    return 0;
  23.  
  24.